package com.smzd.framework.utils.db;

import com.smzd.core.domain.IScopedEntity;
import com.smzd.core.domain.IntIdEntity;

/**
 * SRPage：添加了scope属性的RPage。Scope只要是IntIdEntity就可以。此时要求元素类型是以Scope为scope的元素类型。
 * 
 * @author yuzhongda
 * 
 * @param <S>
 *            Scope参数类型。
 * @param <E>
 *            elems参数类型，都以Scope为scope。
 */
public class SRPage<S extends IntIdEntity, E extends IScopedEntity<S>> extends RPage<E> implements Scopeable<S> {

	private S scope;

	public void setScope(S scope) {
		this.putParam("scopeid", scope == null ? null : scope.getId());
		this.scope = scope;
	}

	public S getScope() {
		return scope;
	}

}
